.chat-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  max-width: 800px;
  margin: 0 auto;
  border: 1px solid #e0e0e0;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  position: relative;
}

.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.header-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ws-status {
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 4px;
}

.ws-status.已连接 {
  background-color: #52c41a;
  color: white;
}

.ws-status.连接中 {
  background-color: #1890ff;
  color: white;
}

.ws-status.已断开 {
  background-color: #ff4d4f;
  color: white;
}

.unread-count {
  font-size: 12px;
  background-color: #ff4d4f;
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
}

.unread-messages-count {
  font-size: 12px;
  background-color: #1890ff;
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  margin-left: 8px;
}

.mark-read-btn {
  font-size: 12px;
  background-color: #52c41a;
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  margin-left: 8px;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
}

.mark-read-btn:hover {
  background-color: #389e0d;
  transform: translateY(-1px);
}

.leave-btn {
  padding: 10px 18px;
  background: linear-gradient(135deg, #ff4d4f 0%, #cf1322 100%);
  color: white;
  border: none;
  border-radius: 20px;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(255, 77, 79, 0.3);
}

.leave-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 77, 79, 0.4);
}

.test-read-btn {
  font-size: 12px;
  background-color: #1890ff;
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  margin-left: 8px;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
}

.test-read-btn:hover {
  background-color: #096dd9;
  transform: translateY(-1px);
}

.chat-messages {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  background-color: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
}

.message-group {
  margin-bottom: 32px;
}

.date-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 32px 0;
}

.date-divider::before,
.date-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid #e0e0e0;
}

.date-text {
  padding: 0 16px;
  color: #888;
  font-size: 14px;
  background-color: #ffffff;
}

.message-item {
  display: flex;
  margin-bottom: 16px;
  animation: slideInUp 0.3s ease-out;
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.other-message {
  justify-content: flex-start;
}

.self-message {
  justify-content: flex-end;
}

.message-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  justify-content: center;
  align-items: center;
  margin-right: 12px;
  color: white;
  font-weight: bold;
  font-size: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  border: 2px solid rgba(255, 255, 255, 0.2);
}

.self-message .message-avatar {
  margin-right: 0;
  margin-left: 12px;
  background: linear-gradient(135deg, #007AFF 0%, #0056CC 100%);
}

.message-content {
  max-width: 70%;
  padding: 12px 16px;
  border-radius: 18px;
  position: relative;
  word-wrap: break-word;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.other-message .message-content {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  color: #333;
  border-bottom-left-radius: 6px;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.self-message .message-content {
  background: linear-gradient(135deg, #007AFF 0%, #0056CC 100%);
  color: white;
  border-bottom-right-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3);
}

.message-content:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.self-message .message-content:hover {
  box-shadow: 0 6px 16px rgba(0, 122, 255, 0.4);
}

.message-user {
  font-weight: bold;
  margin-bottom: 6px;
  font-size: 14px;
  opacity: 0.9;
}

.other-message .message-user {
  color: #555;
}

.self-message .message-user {
  color: rgba(255, 255, 255, 0.9);
  text-align: right;
}

.message-text {
  font-size: 16px;
  line-height: 1.5;
  margin-bottom: 6px;
  word-break: break-word;
}

.message-time {
  font-size: 11px;
  color: #888888;
  text-align: right;
  opacity: 0.7;
}

.self-message .message-time {
  color: rgba(255, 255, 255, 0.7);
  text-align: right;
}

.other-message .message-time {
  color: #999;
  text-align: left;
}

.message-status {
  font-size: 11px;
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.message-status.sending {
  color: #1890ff;
}

.message-status.failed {
  color: #ff4d4f;
}

.message-status i {
  font-size: 10px;
}

.loading-more, .no-more-messages, .pull-to-load-hint {
  text-align: center;
  padding: 15px;
  font-size: 14px;
  color: #888;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.pull-to-load-hint {
  background: rgba(0, 122, 255, 0.1);
  border-radius: 8px;
  margin: 10px;
  color: #007AFF;
  animation: pulse 2s infinite;
}

.pull-to-load-hint i {
  font-size: 16px;
}

@keyframes pulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

.scroll-to-bottom-btn {
  position: fixed;
  bottom: 120px;
  right: 20px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: linear-gradient(135deg, #007AFF 0%, #0056CC 100%);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3);
  transition: all 0.3s ease;
  z-index: 9999;
}

.scroll-to-bottom-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 122, 255, 0.4);
}

.retry-btn {
  margin-left: 5px;
  padding: 4px 8px;
  background: linear-gradient(135deg, #1890ff 0%, #096dd9 100%);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 1px 4px rgba(24, 144, 255, 0.3);
}

.retry-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(24, 144, 255, 0.4);
}

.chat-input {
  display: flex;
  padding: 16px;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
}

textarea {
  flex: 1;
  padding: 12px 16px;
  border: 2px solid rgba(0, 122, 255, 0.2);
  border-radius: 20px;
  resize: none;
  height: 80px;
  margin-right: 12px;
  font-size: 16px;
  transition: all 0.3s ease;
  background: rgba(255, 255, 255, 0.9);
}

textarea:focus {
  outline: none;
  border-color: #007AFF;
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

.send-btn {
  padding: 12px 20px;
  background: linear-gradient(135deg, #007AFF 0%, #0056CC 100%);
  color: white;
  border: none;
  border-radius: 20px;
  cursor: pointer;
  align-self: flex-end;
  font-weight: bold;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 122, 255, 0.3);
}

.send-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 122, 255, 0.4);
}

/* 未读状态指示器 */
.unread-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
  font-size: 11px;
  opacity: 0.8;
  justify-content: flex-end;
}

.unread-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #999;
  animation: pulse 2s infinite;
}

.read-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #52c41a;
  animation: none;
}

.read-status-text {
  font-size: 10px;
  color: #999;
}

.self-message .read-status-text {
  color: rgba(255, 255, 255, 0.7);
}

/* 已读状态样式 */
.message-read .unread-indicator {
  display: none;
}

.message-read .unread-dot {
  background-color: #52c41a;
  animation: none;
} 